package com.zhou.cloud.service.impl;

import com.zhou.cloud.annotation.RedisLock;
import com.zhou.cloud.annotation.ZookeeperLock;
import com.zhou.cloud.service.ITestService;
import org.springframework.stereotype.Service;

import java.util.concurrent.TimeUnit;

/**
 * @descrition:
 * @author: zhouyongjun
 * @date: 2022/11/3
 **/
@Service
public class TestServiceImpl implements ITestService {
    @RedisLock(key="ana:test",requestId = "t",expireTime = 20,waitTime = 10)
    @Override
    public boolean testRedis() {
        System.out.println("test...............");
        return false;
    }

    @ZookeeperLock(key = "/test/annotation/lock", waitTime = 10)
    @Override
    public boolean testZookeeper() {
        System.out.println("test2...............");
        return false;
    }
}
